var gulp = require("gulp");
var babel = require("gulp-babel");
var jshint = require('gulp-jshint');       //js检查
var uglify = require('gulp-uglify');       //js压缩
var rename = require('gulp-rename');       //重命名
var concat = require('gulp-concat');       //合并文件


//压缩并合并js
gulp.task('js', function () {
    //var jsSrc = ['src/*.js']; //先后顺序会乱
    var jsSrc = [
        'src/lucky.js',
        'src/run.js',
        'src/grid.js',
        'src/tiger.js',
        'src/cirlce.js'
    ];
   
    gulp.src(jsSrc)
        .pipe(concat('lucky.js'))//合并为 lucky.js
        .pipe(rename({ suffix: '.min' }))//重命名
        .pipe(uglify())//js压缩
        .pipe(gulp.dest('js/'));
});


gulp.task('default',['js']);